void irq_uart()
{
	/*
	int *flag = 0x40000000;	//mode flag
	int *mode_num = 0x40000004;	//Store function number
	int *unit_num = 0x40000008;	//Store unit number
	int *data_num = 0x40000010;	//Store how many data has been stored
	int *data_add = 0x40000020;	//Store user_ID & M1~M16 & N1~N16

	int *uart_data = 0x80000100;
	int *uart_status = 0x80000104;
	int *GPIO = 0x80000500;
	int *UserID_add = 0xB1012288;	//User ID address
	int *M_add = 0xB1012200;
	int *SYW = 0xB0000000;	//SYW1~8
	int *Bit22 = 0xB0000028;
	int *Bit23 = 0xB000002C;
	int i;
	
	if( *flag == 0x0 )
	{
		 if( *uart_data == 0x5A )
		 	*flag = 0x03;
		 else
		 	*flag = 0x0;
	}
	else if( *flag == 0x03 )
	{
		if( *uart_data == 0xA5 )
		 	*flag = 0x04;
		else
			*flag = 0x0;
	}
	else if( *flag == 0x04 )
	{
		*mode_num = (*uart_data) >> 3;
		*flag = 0x05;
	}
	else if( *flag == 0x05 )
	{
		i = *uart_data;
		*flag = 0x06;
	}
	else if( *flag == 0x06)
	{
		*unit_num = ((*GPIO) >> 8) & 0x0000001F;	//GPIO[8-12]
		if( (*unit_num) == (*uart_data) )	//unit number match
		{		
			if( *mode_num == 0x01 )	//mode 1
				*flag = 0x10;
			else if( *mode_num == 0x02 )	//mode 2
			{
				*data_num = 0x0;
				*flag = 0x20;
			}
			else if( *mode_num == 0x10 )	//mode 3
				*flag = 0x30;
			else if( *mode_num == 0x11 )	//mode 4
				*flag = 0x40;
			else
				*flag = 0x0;
		}
		else
			*flag = 0x0;
	}
	else if( *flag == 0x10 )	//mode 1
	{
		if( *uart_data == 0xF5 )
		{
			*(GPIO+1) = *(GPIO+1) | 0x2;	//GPIO[1] = 1
			*uart_data = 0x55;
			*uart_data = *unit_num;
			*uart_data = (*UserID_add) >> 8;
			*uart_data = (*UserID_add) & 0x000000FF;
			while( (*uart_status & 0x00000080 ) == 0x0) ;	//wait until fifo is half-empty
			*uart_data = 0xEE;
			while( (*uart_status & 0x00000004 ) == 0x0) ;	//wait until all data is sent
			*(GPIO+1) = *(GPIO+1) & 0xFFFFFFFD;	//GPIO[1] = 0
		}
		*flag = 0x0;
	}
	else if( *flag == 0x20 )	//mode 2
	{
		if( *data_num < 66 )
		{
			if( (*data_num)%2 == 0)
				*(data_add+(*data_num)/2) = (*uart_data) << 8;
			else
				*(data_add+(*data_num)/2) = (*(data_add+(*data_num)/2)) | (*uart_data);
			*data_num = *data_num + 1;
		}
		else if( *uart_data == 0xF5 )
		{
			*UserID_add = *data_add;	//write user ID to E2
			for( i=1; i<33; i++ )
			{
				*(M_add+i-1) = *(data_add+i);
				while( *(M_add+i-1) != *(data_add+i) );	//wait until data is stored
			}
			*flag = 0x0;
		}
		else
			*flag = 0x0;
	}
	else if( *flag == 0x30 )	//mode 3
	{
		if( *uart_data == 0xF5 )
		{
			*(GPIO+1) = *(GPIO+1) | 0x2;	//GPIO[1] = 1
			*uart_data = 0x55;
			*uart_data = 0x50;
			*uart_data = (*Bit22) >> 8;
			*uart_data = (*Bit22) & 0x000000FF;
			while( (*uart_status & 0x00000080 ) == 0x0) ;	//wait until fifo is half-empty
			*uart_data = (*Bit23) >> 8;
			while( (*uart_status & 0x00000080 ) == 0x0) ;	//wait until fifo is half-empty
			*uart_data = 0xEE;
			while( (*uart_status & 0x00000004 ) == 0x0) ;	//wait until all data is sent
			*(GPIO+1) = *(GPIO+1) & 0xFFFFFFFD;	//GPIO[1] = 0
		}
		*flag = 0x0;
	}
	else if( *flag == 0x40 )	//mode 4
	{
		if( *uart_data == 0xF5 )
		{
			*(GPIO+1) = *(GPIO+1) | 0x2;	//GPIO[1] = 1
			*uart_data = 0x55;
			for( i=0; i<32; i++ )	//sent SYW1~8, Bit20~73
			{
				*uart_data = *(SYW+i) >> 8;
				while( (*uart_status & 0x00000080 ) == 0x0) ;	//wait until fifo is half-empty
				*uart_data = *(SYW+i) & 0x000000FF;
				while( (*uart_status & 0x00000080 ) == 0x0) ;	//wait until fifo is half-empty
			}
			*uart_data = 0x00;
			while( (*uart_status & 0x00000080 ) == 0x0) ;	//wait until fifo is half-empty
			*uart_data = 0x00;
			while( (*uart_status & 0x00000080 ) == 0x0) ;	//wait until fifo is half-empty
			*uart_data = 0xEE;
			while( (*uart_status & 0x00000004 ) == 0x0) ;	//wait until all data is sent
			*(GPIO+1) = *(GPIO+1) & 0xFFFFFFFD;	//GPIO[1] = 0
		}
		*flag = 0x0;
	}
	else
		*flag = 0x0;
		
	*/	
} 
